package cn.tedu.micro.demo.order.controller;

import cn.tedu.micro.demo.common.result.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/order/submit")
    public JsonResult submitOrder(String userId, String productCode, Integer count) {
        orderService.submitOrder(userId, productCode, count);
        return JsonResult.ok();
    }
}
